package com.ms.pda.db

import androidx.room.*
import com.ms.pda.model.table.StorageOutDO
import kotlinx.coroutines.flow.Flow

@Dao
interface StorageDAO {


    //无单出库记录
    @Transaction
    @Query("SELECT * FROM storage_out WHERE order_no = :orderNumber")
    fun queryStorageOut(orderNumber: String): Flow<List<StorageOutDO>>

    //无单出库记录
    @Transaction
    @Query("SELECT * FROM storage_out")
    fun queryStorageOut(): Flow<List<StorageOutDO>>

    //删除出库记录
    @Query("DELETE FROM storage_out")
    suspend fun deleteStorageOut()

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertStorageOut(newList: List<StorageOutDO>)


}